package personal;

import personal.parser.*;
import personal.scanner.MyScanner;
import personal.scanner.ScannerDFA;

import java.util.List;

public class TestFactory implements Factory {
    @Override
    public ScannerDFA makeScannerDFA() {
        throw new UnsupportedOperationException();
    }

    @Override
    public MyScanner makeScanner() {
        return null;
    }

    @Override
    public Grammar makeGrammar() {
        List<String> nonTerminalSymbolExpressions = List.of("S`", "S", "X");
        List<String> terminalSymbolExpressions = List.of("a", "b", "$");
        SimpleGrammar grammar = new SimpleGrammar("S", nonTerminalSymbolExpressions, terminalSymbolExpressions, "  ", "S`  S", "S  S  a  S", "S  b");
        return grammar;
    }


    @Override
    public ParserTable makeParserTable() {
        return new SimpleParserTable(this.makeGrammar(), null);
    }

    @Override
    public MyParser makeParser() {
        return new SimpleParser(this.makeParserTable());
    }


}
